package com.share.user.api;

import com.share.common.core.constant.ServiceNameConstants;
import com.share.common.core.domain.R;
import com.share.user.api.domain.UpdateUserLogin;
import com.share.user.api.domain.UserInfo;
import com.share.user.api.factory.RemoteUserInfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;

import java.util.Map;

/**
 * @author ZhouShuang
 * @version 17
 * @Title
 * @date 2025/10/17 下午8:20
 */
@FeignClient(contextId = "remoteUserInfoService",value = ServiceNameConstants.SHARE_USER,fallbackFactory = RemoteUserInfoFallbackFactory.class)
public interface RemoteUserInfoService {

    @GetMapping("/userInfo/wxLogin/{code}")
     R<UserInfo> wxLogin(@PathVariable("code") String code);

    @PutMapping("/userInfo/updateUserLogin")
    R<Boolean> updateUserLogin(UpdateUserLogin updateUserLogin);

    @GetMapping("/userInfo/getUserInfo/{userId}")
    R<UserInfo> getUserInfo(@PathVariable("userId") Long userId);

    @GetMapping("/userInfo/getUserCount")
    R<Map<String,Object>> getUserCount();
}
